<template>
  <div class="orderPage">
    <div class="orderPage-top">
      <!-- 搜索 -->
      <div class="serach">
        <i></i>
        <span>搜索历史订单</span>
      </div>
    </div>
    <!-- 购买列表 -->
    <div class="shoppinglist">
      <div class="shoppinglist-d">
        <div class="shoppinglist-title">
          <div class="shopname">
            华润苏果-六合紫晶店
            <div></div>
          </div>
          <span class="Prompt-text">已取消</span>
        </div>
        <div class="shoppingTime">03-09 16:13</div>
      </div>
      <!-- 购买商品图 -->
      <div class="shoppingitemsimage">
        <div class="itemsImage" v-for="{id,imgUrl} in itemsImage" :key="id">
          <img :src="imgUrl" />
        </div>
        <div class="OmissionOfCommodities"></div>
        <div class="CommodityInformation">
          <span class="itemsNode"
          v-for="{id,title} in CommodityInformation" :key="id">{{title}}</span>
        </div>
      </div>
      <!-- 再次后买 -->
      <div class="shoppingAgain">
        <span>再次购买</span>
      </div>
    </div>
    <div class="OrderPageEnd">已经到底啦</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      itemsImage: [],
      CommodityInformation: [],
    };
  },
  created() {
    this.getitemsImage();
    this.getCommodityInformation();
  },
  methods: {
    async getitemsImage() {
      const {
        data: { data },
      } = await this.api.getitemsImage();
      this.itemsImage = data;
    },
    async getCommodityInformation() {
      const {
        data: { data },
      } = await this.api.getCommodityInformation();
      this.CommodityInformation = data;
    },
  },
};
</script>

<style lang="scss" scoped>
.orderPage {
  background-color: #f6f6f6;
  height: 618px;
  .orderPage-top {
    height: 30px;
    padding: 10px 7px;
    background-color: #fff;
    .serach {
      background: rgb(248, 248, 248);
      border-radius: 17px;
      height: 30px;
      padding-left: 30px;
      padding-right: 30px;
      text-align: center;
      line-height: 30px;
      position: relative;
      > i {
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-right: 10px;
        background: url(../../public/uploads/Searchtwo.png) no-repeat;
        background-size: 100%;
        position: absolute;
        top: 30%;
        left: 32%;
      }
      > span {
        color: rgb(102, 102, 102);
        line-height: 30px;
        font-size: 14px;
      }
    }
  }
  .shoppinglist {
    width: 100%;
    height: 168px;
    padding-bottom: 15px;
    margin-bottom: 10px;
    background-color: #fff;
    .shoppinglist-d {
      height: 53px;
      padding-left: 10px;
      padding-right: 10px;
      .shoppinglist-title {
        height: 20px;
        padding-top: 11px;
        padding-bottom: 2px;
        display: flex;
        justify-content: space-between;
        .shopname {
          display: inline-block;
          font-size: 15px;
          font-weight: bold;
          height: 20px;
          color: rgb(51, 51, 51);
          width: 230px;
          > div {
            display: inline-block;
            height: 7px;
            width: 7px;
            border-right: 1px solid rgb(51, 51, 51);
            border-bottom: 1px solid rgb(51, 51, 51);
            margin-left: 6px;
            transform: translateX(-3.25px) rotate(-45deg);
            transform-origin: center center;
          }
        }
        .Prompt-text {
          display: inline-block;
          width: 80px;
          height: 16.8px;
          font-size: 13px;
          text-align: right;
          color: rgb(153, 153, 153);
          font-family: PingFangSC-Regular;
        }
      }
      .shoppingTime {
        height: 16px;
        font-size: 12px;
        color: rgb(153, 153, 153);
      }
    }
    .shoppingitemsimage {
      height: 53px;
      padding: 15px 10px 0px 10px;
      display: flex;
      .itemsImage {
        width: 50px;
        height: 50px;
        margin-right: 9.995px;
        > img {
          width: 50px;
        }
      }
      .OmissionOfCommodities {
        width: 22px;
        height: 4px;
        background: url(../../public/uploads/Ellipsis.png) no-repeat;
        background-size: 100%;
        margin-top: 23px;
      }
      .CommodityInformation {
        width: 90px;
        height: 51.2px;
        text-align: right;
        > .itemsNode:nth-child(1) {
          display: block;
          color: rgb(255, 87, 87);
          font-size: 15px;
          line-height: 17px;
        }
        > .itemsNode:nth-child(2) {
          display: block;
          color: rgb(102, 102, 102);
          font-size: 13px;
          line-height: 15px;
          text-align: right;
        }
        > .itemsNode:nth-child(3) {
          display: inline-block;
          border: 1px solid rgb(22, 169, 255);
          padding: 0 3px;
          color: rgb(22, 169, 255);
          font-size: 10px;
          border-top-right-radius: 1px;
          border-top-left-radius: 4px;
          border-bottom-right-radius: 4px;
          border-bottom-left-radius: 1px;
        }
      }
    }
    .shoppingAgain {
      height: 32px;
      margin-top: 15px;
      text-align: right;
      > span {
        display: inline-block;
        border: 1px solid rgb(218, 218, 218);
        border-radius: 16px;
        height: 32px;
        margin-right: 10px;
        font-size: 14px;
        text-align: center;
        padding-left: 14px;
        padding-right: 14px;
        line-height: 32px;
      }
    }
  }
  .OrderPageEnd {
    padding-top: 30px;
    padding-bottom: 30px;
    text-align: center;
    font-size: 12px;
    line-height: 15px;
  }
}
</style>
